package DesignMode.Flyweight;

import JavaSe.Obj;

import java.util.HashMap;
import java.util.Map;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}16:46
 */
public class FlyweightFactory {
    private Map<String, Object> flyweights = new HashMap();

    public FlyweightFactory() {
        flyweights.put("X",new ConcreteFlyweight());
        flyweights.put("Y",new ConcreteFlyweight());
        flyweights.put("Z",new ConcreteFlyweight());
    }

    public Flyweight GetFlyweight(String key){
        return (Flyweight) flyweights.get(key);
    }
}
